title: "Using walmartR"
author: "Elka Mao"
date: "r Sys.Date()
"
output:
md_document:
variant: markdown_github
--walmartR: Access Walmart.com via R
=======================================
To install the latest version from Github
# install.packages('devtools') devtools::install_github("Elkamao/walmartR")
Next, load the package:
library(walmartR)
To start, register an developer account on Walmart Open API (see https://developer.walmartlabs.com/member) and obtain an API key.
wal_key = [Your API key]
You can look up one item at a time.
product_lookup(wal_key, "12417832")
Or you can look up a list of items at the same time.
product_lookup(wal_key, "12417832,19336123")
Search for Ipod
item_search(wal_key, query ="ipod")
Search for TVs with facets on
item_search(wal_key, query = "tv", facet = "on")
You can use the facet name and any of the facet values to further narrow down the search. To search for TVs of only a particular brand, say Samsung:
item_search(wal_key, query = "tv", facet = "on", facet_filter = "brand:Samsung")
taxonomy(wal_key)
Each item on Walmart.com has a particular item ID associated with it. This can be generally seen in the last 8 digits of a URL string, but can also be acquired by using the product_lookup function (Required)
product_recommendation(wal_key, "36904791")
Same item Id as used in the prouct recommendation fucntion.
postbrowse_recommendation(wal_key, "36904791")
Nearest walmart stores for latitude 29.735577 and longitude -95.511747
store_locator(wal_key, lon="-95.511747", lat="29.735577")
Walmart stores in the city of New York
store_locator(wal_key, city = "NEW YORK")
Walmart stores in the zip 10025
store_locator(wal_key, zip = "10025")
trending(wal_key)
https://developer.walmartlabs.com/docs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.